package org.example.blog.dao;

import org.example.blog.pojo.Label;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface LableDao extends JpaRepository<Label, String>, JpaSpecificationExecutor<Label> {

    @Modifying
    int deleteOneById(String id);



    @Modifying
    @Query(value = "DELETE FROM `tb_labels` where id = ?", nativeQuery = true)
    int customDeleteLabelById(String id);


    /*
    * 根据ID查找
    *
    * */
    Label findOneById(String id);
}
